package com.ruoyi.trace.service.impl;

import java.util.List;
import java.util.Map;
import java.util.UUID;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.trace.mapper.BusTraceBaseinfoMapper;
import com.ruoyi.trace.domain.BusTraceBaseinfo;
import com.ruoyi.trace.service.IBusTraceBaseinfoService;

/**
 * 溯源仪信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-24
 */
@Service
public class BusTraceBaseinfoServiceImpl implements IBusTraceBaseinfoService 
{
    @Autowired
    private BusTraceBaseinfoMapper busTraceBaseinfoMapper;

    /**
     * 查询溯源仪信息
     * 
     * @param id 溯源仪信息主键
     * @return 溯源仪信息
     */
    @Override
    public BusTraceBaseinfo selectBusTraceBaseinfoById(String id)
    {
        return busTraceBaseinfoMapper.selectBusTraceBaseinfoById(id);
    }

    /**
     * 查询溯源仪信息列表
     * 
     * @param busTraceBaseinfo 溯源仪信息
     * @return 溯源仪信息
     */
    @Override
    public List<BusTraceBaseinfo> selectBusTraceBaseinfoList(BusTraceBaseinfo busTraceBaseinfo)
    {
        return busTraceBaseinfoMapper.selectBusTraceBaseinfoList(busTraceBaseinfo);
    }

    @Override
    public List<Map> treelist() {
        return busTraceBaseinfoMapper.treelist();
    }

    /**
     * 新增溯源仪信息
     * 
     * @param busTraceBaseinfo 溯源仪信息
     * @return 结果
     */
    @Override
    public int insertBusTraceBaseinfo(BusTraceBaseinfo busTraceBaseinfo)
    {
        busTraceBaseinfo.setId(UUID.randomUUID().toString());
        busTraceBaseinfo.setCreatetime(DateUtils.getNowDate());
        return busTraceBaseinfoMapper.insertBusTraceBaseinfo(busTraceBaseinfo);
    }

    /**
     * 修改溯源仪信息
     * 
     * @param busTraceBaseinfo 溯源仪信息
     * @return 结果
     */
    @Override
    public int updateBusTraceBaseinfo(BusTraceBaseinfo busTraceBaseinfo)
    {
        return busTraceBaseinfoMapper.updateBusTraceBaseinfo(busTraceBaseinfo);
    }

    /**
     * 批量删除溯源仪信息
     * 
     * @param ids 需要删除的溯源仪信息主键
     * @return 结果
     */
    @Override
    public int deleteBusTraceBaseinfoByIds(String[] ids)
    {
        return busTraceBaseinfoMapper.deleteBusTraceBaseinfoByIds(ids);
    }

    /**
     * 删除溯源仪信息信息
     * 
     * @param id 溯源仪信息主键
     * @return 结果
     */
    @Override
    public int deleteBusTraceBaseinfoById(String id)
    {
        return busTraceBaseinfoMapper.deleteBusTraceBaseinfoById(id);
    }
}
